package com.automannn.springboot.practice.applicationContextFactory;

import org.springframework.boot.ApplicationContextFactory;
import org.springframework.boot.WebApplicationType;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.GenericApplicationContext;

/**
 * @author chenkh
 * @time 2021/10/8 9:56
 */
public class ApplicationContextFactoryTest {
    public static void main(String[] args) {
        ApplicationContextFactory  factory = ApplicationContextFactory.ofContextClass(GenericApplicationContext.class);
        ConfigurableApplicationContext applicationContext= factory.create(null);
        System.out.println(applicationContext);
        ApplicationContextFactory  factory1 = ApplicationContextFactory.DEFAULT;
       ConfigurableApplicationContext configurableApplicationContext= factory1.create(WebApplicationType.NONE);
        System.out.println(configurableApplicationContext);
    }
}
